-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new lint: unnecessary_reserve
#14114
base: master
Are you sure you want to change the base?
new lint: unnecessary_reserve
#14114
Conversation
unnecessary_reserve
@samueltardieu Samuel, really appreciate your review and points! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you include a test (maybe I've missed it) where extend()
happens before reserve()
, to make sure the lint doesn't trigger?
|
||
// do not lint | ||
vec.reserve(1); | ||
vec.extend([1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, error markers are now required in order for tests to pass. If you rebase over master, you will see examples in all the UI test files.
Also, is there any reason why this lint is not under the |
resurrection of #10157
fixes #8982
changelog: [
unnecessary_reserve
]: add new lint unnecessary_reserve